package com.xique.door.device.freeview.service.impl;


import com.xique.common.core.text.Convert;
import com.xique.common.core.utils.DateUtils;
import com.xique.door.device.freeview.bean.domain.FreeviewEventRecord;
import com.xique.door.device.freeview.mapper.FreeviewEventRecordMapper;
import com.xique.door.device.freeview.service.IFreeviewEventRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 全视通事件结果记录Service业务层处理
 * 
 * @author caogq
 * @date 2021-10-21
 */
@Service
public class FreeviewEventRecordServiceImpl implements IFreeviewEventRecordService
{
    @Autowired
    private FreeviewEventRecordMapper freeviewEventRecordMapper;

    /**
     * 查询全视通事件结果记录
     * 
     * @param id 全视通事件结果记录ID
     * @return 全视通事件结果记录
     */
    @Override
    public FreeviewEventRecord selectFreeviewEventRecordById(Long id)
    {
        return freeviewEventRecordMapper.selectFreeviewEventRecordById(id);
    }

    /**
     * 查询全视通事件结果记录列表
     * 
     * @param freeviewEventRecord 全视通事件结果记录
     * @return 全视通事件结果记录
     */
    @Override
    public List<FreeviewEventRecord> selectFreeviewEventRecordList(FreeviewEventRecord freeviewEventRecord)
    {
        return freeviewEventRecordMapper.selectFreeviewEventRecordList(freeviewEventRecord);
    }

    /**
     * 新增全视通事件结果记录
     * 
     * @param freeviewEventRecord 全视通事件结果记录
     * @return 结果
     */
    @Override
    public int insertFreeviewEventRecord(FreeviewEventRecord freeviewEventRecord)
    {
        freeviewEventRecord.setCreateTime(DateUtils.getNowDate());
        return freeviewEventRecordMapper.insertFreeviewEventRecord(freeviewEventRecord);
    }

    /**
     * 修改全视通事件结果记录
     * 
     * @param freeviewEventRecord 全视通事件结果记录
     * @return 结果
     */
    @Override
    public int updateFreeviewEventRecord(FreeviewEventRecord freeviewEventRecord)
    {
        freeviewEventRecord.setUpdateTime(DateUtils.getNowDate());
        return freeviewEventRecordMapper.updateFreeviewEventRecord(freeviewEventRecord);
    }

    /**
     * 删除全视通事件结果记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFreeviewEventRecordByIds(String ids)
    {
        return freeviewEventRecordMapper.deleteFreeviewEventRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除全视通事件结果记录信息
     * 
     * @param id 全视通事件结果记录ID
     * @return 结果
     */
    @Override
    public int deleteFreeviewEventRecordById(Long id)
    {
        return freeviewEventRecordMapper.deleteFreeviewEventRecordById(id);
    }
}
